'use strict';
const db = uniCloud.database()
const dbCmd = db.command
exports.main = async (event, context) => {
	const collection = db.collection('travel-destination')
	const destination = event.destination;
	const type = event.type;
	const filter = {};
	destination ? filter.destination = destination:'';
	type?filter.type = type:'';
	const res = await collection.where(filter)
	.get()
	res.data = res.data.length>0 ? res.data[0] : null;
	return res
};
